<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>首页 - MAPLE后台管理系统</title>
    <link rel="icon" href="../../static/favicon.ico" type="image/ico"/>
    <meta name="keywords" content="枫雨,MAPLE后台管理系统"/>
    <meta name="description" content="MAPLE后台管理系统"/>
    <link href="../../static/admin/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="../../static/admin/css/materialdesignicons.min.css" rel="stylesheet"/>
    <link href="../../static/admin/css/style.min.css" rel="stylesheet"/>
    <link href="../../static/css/login.css" rel="stylesheet" type="text/css"/>
</head>

<body>
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        <aside class="lyear-layout-sidebar">
            <!-- logo -->
            <div id="logo" class="sidebar-header">
                <a href="{{ url_for('home.index') }}"><img src="../../static/admin/images/logo-sidebar.png" title="LightYear"
                                                      alt="LightYear"/></a>
            </div>
            <div class="lyear-layout-sidebar-scroll">
                <nav class="sidebar-main">
                    <ul class="nav nav-drawer">
                        <li class="nav-item active">
                            <a href="{{ url_for('home.index') }}"><i class="mdi mdi-home"></i> 博客首页</a>
                        </li>

                        <li class="nav-item active">
                            <a href="{{ url_for('home.user_index', username=current_user.username) }}">
                                <i class="mdi mdi-home-circle"></i> 我的首页</a>
                        </li>

                        <li class="nav-item">
                            <a href="{{ url_for('post.send_post') }}"><i class="mdi mdi-lead-pencil"></i> 发表文章</a>
                        </li>

                        <li class="nav-item">
                            <a href="#"><i class="mdi mdi-puzzle"></i> 发表说说</a>
                        </li>
                        {% if current_user.id == 1 %}
                        <li class="nav-item">
                            <a href="{{ url_for('user.user_manager') }}"><i class="mdi mdi-account-settings-variant"></i>
                                用户管理</a>
                        </li>
                        {% endif %}

                        <li class="nav-item nav-item-has-subnav">
                            <a href="#"><i class="mdi mdi-information"></i> 我的资料</a>
                            <ul class="nav nav-subnav">
                                <!-- 这里传入的user是一个函数，而不是想当然的以为这是路径/user -->
                                <li><a href="{{ url_for('user.user', username=current_user.username) }}">我的信息</a></li>
                                <li><a href="{{ url_for('user.edit_profile') }}">修改信息</a></li>
                            </ul>
                        </li>

                        <li class="nav-item nav-item-has-subnav">
                            <a href="#"><i class="mdi mdi-message-settings-variant"></i> 评论管理</a>
                            <ul class="nav nav-subnav">
                                <li><a href="{{ url_for('comments.comm_manager') }}">与我相关</a></li>
                                {% if current_user.id == 1 %}
                                <li><a href="{{ url_for('comments.all_comm_manager') }}">所有评论</a></li>
                                <li><a href="{{ url_for('liuyanban.liuyan_manager') }}">留言板</a></li>
                                {% endif %}
                            </ul>
                        </li>

                        <li class="nav-item nav-item-has-subnav">
                            <a href="#"><i class="mdi mdi-book-open-page-variant"></i> 文章管理</a>
                            <ul class="nav nav-subnav">
                                <li><a href="{{ url_for('post.post_manager') }}">我的文章</a></li>
                                {% if current_user.id == 1 %}
                                <li><a href="{{ url_for('post.all_post_manager') }}">用户文章</a></li>
                                {% endif %}
                            </ul>
                        </li>

                    </ul>
                </nav>

                <div class="sidebar-footer">
                    <p class="copyright">
                        Copyright &copy; 2020.
                        <a target="_blank" href="#">MAPLE</a>
                        All rights reserved.
                    </p>
                </div>
            </div>
        </aside>
        <!--End 左侧导航-->

        <!--头部信息-->
        <header class="lyear-layout-header">
            <nav class="navbar navbar-default">
                <div class="topbar">
                    <div class="topbar-left">
                        <div class="lyear-aside-toggler">
                            <span class="lyear-toggler-bar"></span>
                            <span class="lyear-toggler-bar"></span>
                            <span class="lyear-toggler-bar"></span>
                        </div>
                        <span class="navbar-page-title"> 后台管理 </span>
                    </div>

                    <ul class="topbar-right">
                        <li class="dropdown dropdown-profile">
                            <a href="javascript:void(0)" data-toggle="dropdown">
                                <img class="img-avatar img-avatar-48 m-r-10"
                                     src="{{ users.avatar }}" alt="{{ users.username }}"/>
                                <span>{{users.username}} <span class="caret"></span></span>
                            </a>
                            <ul class="dropdown-menu dropdown-menu-right">
                                <li>
                                    <a href="{{ url_for('user.user', username=current_user.username) }}"><i
                                            class="mdi mdi-account"></i> 个人信息</a>
                                </li>
                                <li>
                                    <a href="{{ url_for('user.edit_profile') }}"><i class="mdi mdi-lock-outline"></i>
                                        修改信息</a>
                                </li>
                                <li class="divider"></li>
                                <li>
                                    <a href="{{ url_for('LogOrReg.logout') }}"><i class="mdi mdi-logout-variant"></i> 退出登录</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </nav>
        </header>
        <!--End 头部信息-->

        <!--页面主要内容-->
        <main class="lyear-layout-content">
            <div class="container-fluid">
                {% block content %} {% endblock %}
            </div>
        </main>
        <!--End 页面主要内容-->
    </div>
</div>

<script type="text/javascript" src="../../static/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="../../static/admin/js/bootstrap.min.js"></script>
<script type="text/javascript" src="../../static/admin/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="../../static/admin/js/main.min.js"></script>
<!--富文本-->
<script src="{{ url_for('static', filename='tinymce/js/tinymce/tinymce.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/tinymce_setup.js') }}"></script>
</body>

</html>